#ifndef _PARSE_H_
#define _PARSE_H_

#include "config.h"
#include "events.h"
#include "xml.h"
#include <sys/time.h>
#include <stdio.h>

void init_parser( );
void parse( char *in, char *out );
void get_addr( char *request, char *addr, int n );
void send_compress( char *in, char *out );
void send_main_page( char *out );
void send_expand( char *in, char *out );
void send_error( char *in, char *out );
void adminreset( char *in, char *out );

#define http_head "HTTP/1.1 200 OK\r\nConnection: close\r\nContent-type: text/html; charset=UTF-8\r\n\r\n"
#define redirect_head "HTTP/1.1 302 Found\r\nContent-Type: text/html\r\nContent-length: 0\r\nConnection: close\r\nLocation: "
#define errhead "HTTP/1.0 404 Not Found\r\nConnection: close\r\nContent-type: text/html; charset=UTF-8\r\n\r\n"

//char inbuf [ 2048 ];
//char outbuf[ 3072 ];
//char request[ 2048];
//char xml_resp[2048];
char *path;

char *uris[URI_COUNT];

#define EXPAND_NUM 5
#define COMPRESS_NUM 16

#endif

